function user() {
    //游客来源分析
    $(function() {
        $("#container1").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/showFrom",
                success: function(res) {
                    var data = res.data

                    var myChart = echarts.init($("#container1")[0]);
                    var option = {
                        tooltip: {
                            trigger: 'item',
                            formatter: "{a} <br/>{b} : {c} ({d}%)"
                        },
                        legend: {
                            x: 'center',
                            y: "16",
                            data: [],
                            textStyle: {
                                color: "#e9ebee"
                            }
                        },
                        series: [{
                            itemStyle: {
                                normal: {
                                    label: {
                                        show: false
                                    },
                                    labelLine: {
                                        show: false
                                    }
                                }
                            },
                            name: '',
                            type: 'pie',
                            radius: '55%',
                            center: ['50%', '60%'],
                            data: [{
                                        value: data.shengnei,
                                        name: '省内游客',
                                        itemStyle: {
                                            normal: {
                                                color: "#2864ab"
                                            }
                                        }
                                    },
                                    {
                                        value: data.beiFang,
                                        name: '北上广游客',
                                        itemStyle: {
                                            normal: {
                                                color: "#1afffd"
                                            }
                                        }
                                    },
                                    {
                                        value: data.nanFang,
                                        name: '西南片区',
                                        itemStyle: {
                                            normal: {
                                                color: "#2e7cff"
                                            }
                                        }
                                    },
                                    {
                                        value: data.haiWai,
                                        name: '海外游客',
                                        itemStyle: {
                                            normal: {
                                                color: "#ffcb89"
                                            }
                                        }
                                    },
                                    {
                                        value: data.other,
                                        name: '其他地区',
                                        itemStyle: {
                                            normal: {
                                                color: "#005ea1"
                                            }
                                        }
                                    }

                                ]
                                //data:[
                                //    {value:90, name:'男性'},
                                //    {value:10, name:'女性',
                                //        itemStyle:{
                                //            normal:{
                                //                color:"#ff81cb"
                                //            }
                                //        }}
                                //]
                        }]
                    };



                    myChart.setOption(option);
                }
            });
        })

    });

    //游客性别分析
    $(function() {
        $("#container2").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/showSex",
                success: function(res) {
                    var data = res.data

                    var myChart = echarts.init($("#container2")[0]);
                    var option = {
                        tooltip: {
                            trigger: 'item',
                            formatter: "{a} <br/>{b} : {c} ({d}%)"
                        },
                        legend: {
                            orient: 'vertical',
                            x: 'left',
                            y: "16",
                            data: ['男性', '女性'],
                            textStyle: {
                                color: "#e9ebee"
                            }
                        },
                        series: [{
                            itemStyle: {
                                normal: {
                                    label: {
                                        show: false
                                    },
                                    labelLine: {
                                        show: false
                                    }
                                }
                            },
                            name: '',
                            type: 'pie',
                            radius: '55%',
                            center: ['50%', '60%'],
                            data: [{
                                    value: data.man,
                                    name: '男性',
                                    itemStyle: {
                                        normal: {
                                            color: "#2865aa"
                                        }
                                    }
                                },
                                {
                                    value: data.woman,
                                    name: '女性',
                                    itemStyle: {
                                        normal: {
                                            color: "#ff81cb"
                                        }
                                    }
                                }
                            ]
                        }]
                    };



                    myChart.setOption(option);
                }
            });
        })

    });

    //游客年龄分析
    $(function() {
        $("#container3").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/showAge",
                success: function(res) {

                    var data = res.data

                    var myChart = echarts.init($("#container3")[0]);
                    var option = {
                        tooltip: {
                            trigger: 'item',
                            formatter: "{a} <br/>{b} : {c} ({d}%)"
                        },
                        legend: {
                            orient: 'vertical',
                            x: 'right',
                            y: "16",
                            data: ['少年', '青年', '中年', '老年', '其他'],
                            textStyle: {
                                color: "#e9ebee"
                            }
                        },
                        series: [{
                            itemStyle: {
                                normal: {
                                    label: {
                                        show: false
                                    },
                                    labelLine: {
                                        show: false
                                    }
                                }
                            },
                            name: '',
                            type: 'pie',
                            radius: '55%',
                            center: ['50%', '60%'],
                            data: [{
                                    value: data.shaonian,
                                    name: '少年',
                                    itemStyle: {
                                        normal: {
                                            color: "#45c0ff"
                                        }
                                    }
                                },
                                {
                                    value: data.qingnian,
                                    name: '青年',
                                    itemStyle: {
                                        normal: {
                                            color: "#e15828"
                                        }
                                    }
                                },
                                {
                                    value: data.zhongnian,
                                    name: '中年',
                                    itemStyle: {
                                        normal: {
                                            color: "#005ea1"
                                        }
                                    }
                                },
                                {
                                    value: data.laoNian,
                                    name: '老年',
                                    itemStyle: {
                                        normal: {
                                            color: "#ff81cb"
                                        }
                                    }
                                },
                                {
                                    value: data.qita,
                                    name: '其他',
                                    itemStyle: {
                                        normal: {
                                            color: "#2e7cff"
                                        }
                                    }
                                }
                            ]
                        }]
                    };
                    myChart.setOption(option);
                }
            });
        })

    });

    //散客——团队分析
    $(function() {
        $("#container4").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/findAllTsMonth",

                success: function(res) {
                    var data = res.data
                    const total = []
                    const stourist = []
                    data.forEach((item, i) => {
                        total[i] = item.total
                        stourist[i] = item.stourist
                    })
                    var myChart = echarts.init(document.getElementById('container4'));
                    var option = {
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                            }
                        },
                        //legend: {
                        //    data:['散客（万人）','团队（万人）'],
                        //    y:'20',
                        //    textStyle: { fontWeight: 'bold', color: '#a4a7ab' }
                        //},
                        calculable: true,
                        xAxis: [{
                            type: 'category',
                            data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab',
                                    align: 'center'
                                }
                            }
                        }],
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        yAxis: [{
                            type: 'value',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        }],
                        series: [{
                                name: '散客（万人）',
                                type: 'bar',
                                stack: '广告',
                                barWidth: '30',
                                data: stourist,
                                itemStyle: {
                                    normal: {
                                        color: "#1afffd"
                                    }
                                }
                            },
                            {
                                name: '团队（万人）',
                                type: 'bar',
                                stack: '广告',
                                data: total,
                                itemStyle: {
                                    normal: {
                                        color: "#2e7cff"
                                    }
                                }
                            }
                        ]
                    };


                    myChart.setOption(option);
                }
            });
        })

    });

    //天气游客数据分析
    $(function() {
        $("#container5").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/findWeather",
                data: "data",
                dataType: "json",
                success: function(res) {
                    var data = res.data
                    const names = []
                    const squantity = []
                    const tquantity = []
                    data.forEach((item, i) => {
                        names[i] = item.name
                        squantity[i] = item.squantity
                        tquantity[i] = item.tquantity
                    })
                    var myChart = echarts.init(document.getElementById('container5'));
                    var option = {
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                            }
                        },
                        //legend: {
                        //    data:['散客人数（万人）','团队人数（万人）'],
                        //    textStyle: { fontWeight: 'bold', color: '#a4a7ab' }
                        //},
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        xAxis: [{
                            type: 'category',
                            data: names,
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab',
                                    align: 'center'
                                }
                            }
                        }],
                        yAxis: [{
                            type: 'value',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        }],
                        series: [{
                                name: '散客人数（万人）',
                                type: 'bar',
                                data: squantity,
                                itemStyle: {
                                    normal: {
                                        color: "#2e7cff"
                                    }
                                }
                            },
                            {
                                name: '团队人数（万人）',
                                type: 'bar',
                                stack: '广告',
                                data: tquantity,
                                itemStyle: {
                                    normal: {
                                        color: "#0ad5ff"
                                    }
                                }
                            }
                        ]
                    };


                    myChart.setOption(option);
                }
            });
        })

    });

    //游客出行交通方式分析
    $(function() {
        $("#container6").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/findTrafficVisitor",
                data: "data",
                dataType: "json",
                success: function(res) {
                    var data = res.data

                    var myChart = echarts.init($("#container6")[0]);
                    var option = {
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                            }
                        },
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        calculable: true,
                        xAxis: [{
                            type: 'category',
                            data: ['汽车', '火车', '飞机', '自驾游', '公共交通', '其他'],

                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab',
                                    align: 'center'
                                }
                            }
                        }],
                        yAxis: [{
                            type: 'value',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        }],
                        series: [{
                            name: '游客数量（万人）',
                            type: 'bar',
                            barWidth: '30',
                            data: [data.car, data.driving, data.other, data.plane, data.publics, data.train],
                            itemStyle: {
                                normal: {
                                    color: "#0aff6c"
                                }
                            }

                        }]
                    };
                    myChart.setOption(option);
                }
            });
        })

    });

    //不同时间段入园情况
    $(function() {
        $("#container9").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/findTime",
                data: "data",
                dataType: "json",
                success: function(res) {
                    var data = res.data
                    const names = []
                    const quantity = []
                    data.forEach((item, i) => {
                        names[i] = item.name
                        quantity[i] = item.quantity
                    })
                    var myChart = echarts.init($("#container9")[0]);
                    var option = {
                        tooltip: { //提示框，鼠标悬浮交互时的信息提示
                            show: true,
                            trigger: 'axis'
                        },
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        legend: {
                            data: [],
                            orient: 'vertical',
                            textStyle: { fontWeight: 'bold', color: '#a4a7ab' }
                        },

                        calculable: true,
                        xAxis: [{
                                type: 'category',
                                boundaryGap: false,
                                data: names,
                                splitLine: {
                                    show: false
                                },
                                axisLabel: {
                                    show: true,
                                    //rotate:20,
                                    textStyle: {
                                        color: '#a4a7ab',
                                        align: 'center'
                                    }
                                }
                            }

                        ],
                        yAxis: [{
                            type: 'value',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab',
                                    align: 'right'
                                }
                            }
                        }],
                        series: [{
                            name: '客流量（人）',
                            type: 'line',
                            stack: '客流量',
                            data: quantity,
                            itemStyle: {
                                normal: {
                                    color: '#02bcbc'
                                }
                            }
                        }]
                    };

                    myChart.setOption(option);
                }
            });
        })

    });

    //不同月份游客数量情况
    $(function() {
        $("#container10").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/findVisitorMonth",
                data: "data",
                dataType: "json",
                success: function(res) {
                    var data = res.data
                    const names = []
                    const quantity = []
                    data.forEach((item, i) => {
                        names[i] = item.name
                        quantity[i] = item.quantity
                    })
                    var myChart = echarts.init($("#container10")[0]);
                    var option = {
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                            }
                        },
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        calculable: true,
                        xAxis: [{
                            type: 'category',
                            data: names,

                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab',
                                    align: 'center'
                                }
                            }
                        }],
                        yAxis: [{
                            type: 'value',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        }],
                        series: [{
                            name: '游客数量（万人）',
                            type: 'bar',
                            barWidth: '30',
                            data: quantity,
                            itemStyle: {
                                normal: {
                                    color: "#269fec"
                                }
                            }

                        }]
                    };
                    myChart.setOption(option);
                }
            });
        })

    });

    //不同月份游客走势情况
    $(function() {
        $("#container11").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/findTsMonth",
                data: "data",
                dataType: "json",
                success: function(res) {
                    var data = res.data
                    const stourist = []
                    const tsmonth = []
                    const ttourist = []
                    data.forEach((item, i) => {
                        stourist[i] = item.stourist
                        tsmonth[i] = item.tsmonth
                        ttourist[i] = item.ttourist
                    })
                    var myChart = echarts.init(document.getElementById('container11'));
                    var option = {
                        tooltip: {
                            trigger: 'axis'
                        },
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        calculable: true,
                        xAxis: [{
                            type: 'category',
                            boundaryGap: false,
                            data: tsmonth,
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        }],
                        yAxis: [{
                            type: 'value',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }

                        }],
                        series: [{
                                name: '散客',
                                type: 'line',
                                stack: '人',
                                data: stourist,
                                itemStyle: {
                                    normal: {
                                        color: "#e15828"
                                    }
                                }
                            },
                            {
                                name: '团队',
                                type: 'line',
                                stack: '人',
                                data: ttourist,
                                itemStyle: {
                                    normal: {
                                        color: "#2e7cff"
                                    }
                                }
                            }
                        ]
                    };
                    myChart.setOption(option);
                }
            });
        })

    });

    //出行方式排行
    $(function() {
        $("#container12").html(function() {
            $.ajax({
                type: "get",
                url: "http://47.98.122.157:9527/findTrafficNumber",
                data: "data",
                dataType: "json",
                success: function(res) {
                    var data = res.data
                    const names = []
                    const quantity = []
                    data.forEach((item, i) => {
                        names[i] = item.name
                        quantity[i] = item.quantity
                    })
                    var myChart = echarts.init($("#container12")[0]);
                    var option = {
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                            }
                        },
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        xAxis: {
                            type: 'value',
                            x: '180',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        },
                        yAxis: {
                            type: 'category',
                            data: names,
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        },
                        series: [{
                            name: '出行人数（人）',
                            type: 'bar',
                            stack: '总量',
                            label: {
                                normal: {
                                    show: true,
                                    position: 'insideRight'
                                }
                            },
                            data: quantity,
                            itemStyle: {
                                normal: {
                                    color: "#ff7d0a"
                                }
                            }
                        }]
                    };
                    myChart.setOption(option);
                }
            });
        })

    });

}